package com.bw.mapper;

import com.bw.bean.TestExam;
import com.bw.bean.Vo;
import com.bw.bean.Vo1;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author:
 * @Date: 2025/3/11 19:45
 * @Description:
 **/
@Mapper
public interface VoMapper {

    @Select("call pro1()")
    Double getList1();

    @Select("select b.name,sum(final_amount)value from base_province b\n" +
            "left join order_info oi on b.id = oi.province_id\n" +
            "group by b.name")
    List<Vo> getList2();

    @Select("select paper_title name,avg(score)value from test_paper t\n" +
            "left join test_exam te on t.id = te.paper_id\n" +
            "group by paper_title\n" +
            "having value>60")
    List<Vo> getList3();

    @Select("select max(score)-min(score)value from test_exam")
    Double getList4();

    @Select("select * from test_exam where score=(select max(score) from test_exam)")
    List<TestExam> getList5();

    @Select("select order_status a,count(order_status) b from order_info group by order_status")
    List<Vo1> getList6();

    @Select("select name,count(user_id)value from base_province b\n" +
            "left join order_info oi on b.id = oi.province_id\n" +
            "group by name\n" +
            "having value>10")
    List<Vo> getList7();
}
